#include"Hash.h"

void test1()
{
	Hash_openaddress::HashTables<int, int> hash;
	int a[] = { 19,30,5,36,13,20,21,12 };
	for (auto e : a)
	{
		hash.Insert({ e,e });
	}
	for (auto e : a)
	{
		auto ret=hash.Find(e);
		hash.Erase(ret->_kv.first);
	}

}

void test2()
{
	int a[] = { 19, 30, 5, 36, 13, 20, 21, 12, 24, 96,149,202, };
	Hash_bucket::HashTables<int,int> hash;
	for (auto e : a)
	{
		hash.Insert({ e,e });
	}
	
	cout << hash.Find(96) << endl;
	cout << hash.Find(30) << endl;
	cout << hash.Find(19) << endl;
	cout << endl;
	cout << hash.Erase(202) << endl;
	cout << hash.Erase(96) << endl;
	cout << hash.Erase(149) << endl;
	/*Hash_bucket::HashTables<string,int> hash;
	hash.Insert({ "hello",1 });
	hash.Insert({ "apple",1 });
	hash.Insert({ "exist",1 });
	hash.Insert({ "chinese",1 });

		auto ret = hash.Find("hello");
		hash.Erase(ret->_kv.first);*/
}
int main()
{
	test2();
	return 0;
}